package org.discala.util.logging

/**
 * Abstract trait inherited by any types that want to support logging of
 * status information. Provides five levels of logging: trace, debug, info,
 * warn and error.
 * <p>
 * All of the framework classes and traits extend this one in order to provide
 * logging of container level functionality. The container uses the following
 * criteria for each log level:
 *
 * <ul>
 * <li><b>trace</b> - Low level detail of all activity within the framework</li>
 * <li><b>debug</b> - Useful information for tracking the activities
 * being undertaken by the framework</li>
 * <li><b>info</b> - Information about the current active state of the framework</li>
 * <li><b>warn</b> - An error condition that the framework has been able to recover from</li>
 * <li><b>error</b> - An error condition that the framework has not been able to recover from</li>
 * </ul>
 *
 * In order to provide implementation of the Logged trait, container definitions must mix
 * in an appropriate logger trait. Currently the framework supports the following loggers:
 *
 * <ul>
 * <li><b>{@link NullLogger}</b> - Turns off all logging within the framework</li>
 * <li><b>{@link Slf4jLogger}</b> - Implements logging against the Slf4j framework api</li>
 * <li><b>{@link ConsoleLogger}</b> - All logging directed to the console - for use in development & testing</li>
 * <li><b>{@link AssertableLogger}</b> - A logger for unit testing that allows tests to assert that
 *                                       certain logging records have been written without resorting to
 *                                       pasring files</li>
 * </ul>
 *
 * @author Chris Turner
 */
trait Logged {

  def trace(message: String, values: Any*)
  def trace(message: String, error: Throwable)

  def debug(message: String, values: Any*)
  def debug(message: String, error: Throwable)

  def info(message: String, values: Any*)
  def info(message: String, error: Throwable)

  def warn(message: String, values: Any*)
  def warn(message: String, error: Throwable)

  def error(message: String, values: Any*)
  def error(message: String, error: Throwable)
}